import { createRouter, createWebHistory } from "vue-router";
import HomeView from "@/views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "home",
      component: HomeView,
    },
    {
      path: "/kg",
      name: "kg",
      component: () => import("@/views/KGView.vue"),
      redirect: "/kg/dashboard",
      children: [
        // 主导航-导航
        { path: "dashboard", name: "kg-dashboard", component: () => import("@/views/KG/Dashboard.vue"), },
        // 学科-历史记录
        { path: "history", name: "kg-history", component: () => import("@/views/KG/Subject/HistoryActionView.vue"), },
        // 学科-历史记录-添加
        { path: "history/add", name: "kg-history-add", component: () => import("@/views/KG/Subject/HistoryAddView.vue"), },
        // 学科-物理-量子力学
        { path: "quantum", name: "kg-quantum", component: () => import("@/views/KG/Subject/QuantumView.vue"), },
        // 媒体-电视剧
        { path: "drama", name: "kg-drama", component: () => import("@/views/KG/Media/TVDramaView.vue"), },
        // 媒体-电影
        { path: "movie", name: "kg-movie", component: () => import("@/views/KG/Media/MovieView.vue"), },
        // 媒体-音乐
        { path: "music", name: "kg-music", component: () => import("@/views/KG/Media/MusicView.vue"), },
        // 媒体-书籍-详情
        { path: "book-detail/:book_id", name: "kg-book-detail", component: () => import("@/views/KG/Media/BookDetailView.vue"), },
        // 媒体-书籍-列表
        { path: "book-list", name: "kg-book-list", component: () => import("@/views/KG/Media/BookListView.vue"), },
        // 媒体-书籍-得到
        { path: "book-dedao", name: "kg-book-dedao", component: () => import("@/views/KG/Media/DedaoBookView.vue"), },
        // 媒体-文明之旅-得到
        { path: "wenming-dedao", name: "kg-wenming-dedao", component: () => import("@/views/KG/Media/DedaoWenMingView.vue"), },
        // 媒体-课程-得到
        { path: "course-dedao", name: "kg-course-dedao", component: () => import("@/views/KG/Media/DedaoCourseView.vue"), },
        // 媒体-听书-得到
        { path: "book-audio-dedao", name: "kg-book-audio-dedao", component: () => import("@/views/KG/Media/DedaoAudioBookView.vue"), },
      ],
    },
    {
      path: "/resource",
      name: "resource",
      component: () => import("@/views/ResourceView.vue"),
      redirect: "/resource/dashboard",
      children: [
        // 主导航-导航
        { path: "dashboard", name: "resource-dashboard", component: () => import("@/views/Resource/Dashboard.vue"), },
        // 资源-图片
        { path: "image", name: "resource-image", component: () => import("@/views/Resource/ImageView.vue"), },
      ],
    },
    {
      path: "/user",
      name: "user",
      component: () => import("@/views/User.vue"),
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    },
    {
      path: "/setting",
      name: "setting",
      component: () => import("@/views/Setting.vue"),
    },
  ],
});

export default router;
